<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Find Elements</title>
<script type="text/javascript">
	function onPictureClick()
	{
		var pic = document.getElementsByName('picture')[0];
		pic.style.borderStyle = 'solid';
		pic.style.borderWidth = '2px';
		pic.style.borderColor = 'red';
		pic.src = 'http://www.imperiaonline.bg/bg/wp-content/uploads/2012/09/logo5.png';
	}
	
	function onParClick()
	{
		var timePar = document.getElementById('time');
		
		var dateObj = new Date();
		var currentTime = dateObj.getDate() + ' ' + 
						  dateObj.getMonth() + ' ' +
						  dateObj.getFullYear();
		
		timePar.innerHTML = currentTime;
		//timePar.style = 'color:red;';
		timePar.style.color = 'red';
		timePar.style.backgroundColor = 'green';
		timePar.style.border = '2px solid blue';
	}
	
</script>
</head>
<body>
	<p id="time" onclick="onParClick();">Time</p>
	<img name="picture" onclick="onPictureClick();"
		 src="http://www.imperiaonline.bg/bg/wp-content/themes/Karma/truethemes_framework/extended/timthumb/timthumb.php?src=http://www.imperiaonline.bg/bg/wp-content/uploads/2012/09/io-hp.png&h=201&w=922"/>
</body>
</html>